#include <fstream>
#include <vector>
#include <string>
#include <map>
#include <set>
#include <bitset>
#include <algorithm>
#include <queue>
#include <stack>
#include <assert.h>

using namespace std;
typedef __int64 LONG; 

LONG Factorial(LONG n)
{
	LONG c = 1;

	for (LONG x=2; x<=n; x++)
	{
		c *= x;
	}

	return c;
}

LONG Order(LONG n, LONG m)
{
	LONG s =min(m, n-m);
	LONG b =max(m, n-m);

	LONG c =1;

	for (LONG x =b+1; x<=n; x++)
	{
		c *= x;
	}
	return c/ Factorial(s);
}

LONG Set[501][501];

LONG Count(LONG n, LONG size)
{
	if (size ==1)
		return 1;

	if (Set[n][size])
		return Set[n][size];

	LONG c =0;
	LONG low = max((LONG)1, size-(n-size));

	for (LONG i=low; i<= size -1; i++)
	{
		LONG k =Order(n-size-1, size-i-1);
		LONG s =Count(size, i);
		c += s *k;
	}

	Set[n][size] = c;
	return c;
}

LONG Count(LONG n)
{
	LONG c =0;

	for (LONG i=1; i< n; i++)
	{
		c += Count(n, i);
	}

	return c;
}

void RunCase (ifstream& fin, ofstream& fout)
{
	LONG n;
	fin>>n;

	LONG r = Count(n) % 100003;
	fout<<r;
}

void RunAll(const char* fnameIn, const char* fnameOut)
{
	ifstream fin(fnameIn);
	ofstream fout(fnameOut);

	int caseCount;
	fin >> caseCount;

	for (int i=0; i<caseCount; i++)
	{
		fout<<"Case #"<<i+1<<": ";
		RunCase (fin, fout);
		fout<<"\n";
	}
}

void main()
{
	memset (Set, 0, sizeof(Set));
	LONG c = Count(500);

	//RunAll("C-small-practice.in", "C-small-practice.out");
	//RunAll("C-large-practice.in", "C-large-practice.out");

	return;
}